/*******************************************************************************
 * Copyright (c) 2010 Gary Yund {OTHER COPYRIGHT OWNERS}.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Gary Yund - initial API and implementation and/or initial documentation
 *******************************************************************************/

#import "BB_LoggerTestCase.h"

#import "BB_Logger.h"

@implementation BB_LoggerTestCase

-(void) testSetLogLevel
{
#ifdef USING_BB_LOGGING
    // TEST WHEN MACRO IS SET
    BB_LOGLEVEL( BB_LOG_ANY );    
    STAssertEquals( [[BB_Logger sharedBB_Logger] logLevel ], BB_LOG_ANY,
                   @"Log level was not set");
    
#else
    // TEST WHEN MACRO IS NOT SET
    
    BB_LogLevel_t currentLogLevel = [[BB_Logger sharedBB_Logger] logLevel ];
    
    BB_LOGLEVEL( BB_LOG_ANY );    
    STAssertEquals( [[BB_Logger sharedBB_Logger] logLevel ], currentLogLevel,
                   @"Log level was set when it shouldn't be");
    
#endif
    
}

-(void) testLogMessage
{
#ifdef USING_BB_LOGGING
    BB_LOG(BB_LOG_DEBUG, @"If you can read this, logging is currently enabled");
#else
    BB_LOG(BB_LOG_DEBUG, @"If you can read this, you shouldn't be!");    
#endif
}

@end
